<template>
  <el-dialog :title="title"
             :visible.sync="Visible"
             center
             :width="width"
             v-el-drag-dialog
             :append-to-body='appendToBody'
             @close="$emit('update:show', false)"
             @closed='$emit("update:initTotal",0),closed()'>
    <slot />
    <div slot="footer">
      <slot name="Footer" />
    </div>
  </el-dialog>
</template>

<script>

export default {
  name: 'Dialog',
  data () {
    return {
      Visible: this.show,
      ceshi: {
        a: 1
      }
    }
  },
  watch: {
    show () {
      this.Visible = this.show
    }
  },
  props: {
    title: {
      type: String || Number,
      default: '提示'
    },
    width: {
      type: String,
    },
    show: {
      type: Boolean,
      default: false
    },
    appendToBody: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    closed () {
      this.$emit('initLmit')
    }
  }
}
</script>

<style>
</style>
